package br.unip.tcc.domotic.orm;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "tipo_atuador")
public class ActuatorType extends AbstractORM {
	
	private static final long serialVersionUID = 1L;
	
	private Integer actuatorTypeId;
	private String actuatorTypeDescription;
	private Set<Actuator> actuators = new HashSet<Actuator>(0);
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "cod_tipo_atuador", unique = true, nullable = false)
	public Integer getActuatorTypeId() {
		return actuatorTypeId;
	}
	
	public void setActuatorTypeId(Integer actuatorTypeId) {
		this.actuatorTypeId = actuatorTypeId;
	}
	
	@Column(name = "des_tipo_atuador", nullable = false)
	public String getActuatorTypeDescription() {
		return actuatorTypeDescription;
	}
	
	public void setActuatorTypeDescription(String actuatorTypeDescription) {
		this.actuatorTypeDescription = actuatorTypeDescription;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "actuatorType")
	public Set<Actuator> getActuators() {
		return actuators;
	}
	
	public void setActuators(Set<Actuator> actuators) {
		this.actuators = actuators;
	}
	
}
